<template>
  <div class="ktv">
      <ktv-header/>
      <ktv-recommend :list="recommendList"></ktv-recommend>
      <ktv-foot/>
  </div>
</template>


<script>
// @ is an alias to /src
import KtvHeader from './components/KtvHeader.vue'
import KtvRecommend from './components/KtvRecommend.vue'
import KtvFoot from './components/KtvFoot.vue'
import axios from 'axios'

export default {
  name: 'ktv',
  components: {
    KtvHeader,
    KtvRecommend,
    KtvFoot
  },
  data: function(){
    return{
        recommendList: []
    }
  },
  mounted(){
    this.getKtvApiInfo()
  },
  methods: {
     getKtvApiInfo(){
      axios.get("/mock/KTV/ktv.json").then(this.getKtvResponseInfo)
    },
     getKtvResponseInfo(response){
      // console.log(response.data);
      let res = response.data //就是home.json里面的内容
      if(res.success && res.dataList){
        const data = res.dataList//json里的dataList属性
        this.recommendList = data.recommendList
      }
    }
  }
}
</script>
